package edu.sctu.practice.class01.zhangwang.day2015_10_14.text01;

/**
 * Created by Z_W on 2015/10/14.
 */
public class Runanle implements Runnable{

    private String city;
    public Runanle(){}
    public Runanle(String city){
        this.city = city;
    }

    @Override
    public void run() {
     for (int i = 0;i<10;i++){
         System.out.println(city);
         try {
             Thread.sleep(1000);
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
     }

    }

    public static void main(String[] args) {
        Runanle runanle = new Runanle("上海");

        TreadText treadText = new TreadText("北京");
        Thread t1 = new Thread(runanle);
//        Thread t2 = new Thread(treadText);

        t1.start();
        treadText.start();
//        t2.start();
        System.out.println("你是一个猪。");
    }

}
